@extends('admin.layout.index')


@section('content')

	<div class="mws-panel grid_8">
	<div class="mws-panel-header">
    	<span><i class="icon-table"></i>{{$title}}</span>
    </div>
    <div class="mws-panel-body no-padding">
        <div id="DataTables_Table_1_wrapper" class="dataTables_wrapper" role="grid">
        <div id="DataTables_Table_1_length" class="dataTables_length">
        	<form method="get" action="/admin/reply">
        	<label>显示 
        		<select name="count" aria-controls="DataTables_Table_1">
	        		<option value="10" @if(!empty($request['count']) && $request['count'] == 10) selected @endif>10</option>
	        		<option value="1" @if(!empty($request['count']) && $request['count'] == 1) selected @endif>1</option>
	        		<option value="3" @if(!empty($request['count']) && $request['count'] == 3) selected @endif>3</option>
	        		<option value="5" @if(!empty($request['count']) && $request['count'] == 5) selected @endif>5</option>
	        	</select> 条</label>
	        </div>
	        <div class="dataTables_filter" id="DataTables_Table_1_filter">
	        	<label>关键字: <input type="text" name="search" value="{{$request['search'] or ''}}" aria-controls="DataTables_Table_1"><input type="submit" class="btn btn-success btn-xs" value="搜索"></label>
	        </div>
	        </form>
	        <table class="mws-datatable-fn mws-table dataTable" id="DataTables_Table_1" aria-describedby="DataTables_Table_1_info">
            <thead>
            	<tr>
            		<th>评论ID</th>
                    <th>商品ID</th>
            		<th>用户ID</th>
            		<th>评论内容</th>
            		<th>评论等级</th>
            		<th>评论时间</th>
            		<th>操作</th>
            	</tr>
            </thead>
            
        <tbody role="alert" aria-live="polite" aria-relevant="all">
        		@foreach($comment as $k=>$v)
        		<tr class="odd" style="text-align:center">
                    <td class="">{{$v->gcid}}</td>
                    <td class="">{{$v->gc_gid}}</td>
                    <td class="">{{$v->gc_uid}}</td>
                    <td class="">{{$v->gccontent}}</td>
                    <td class="">{{$v->gcstatus}}</td>
                    <td class="">{{$v->gctime}}</td>
                    <td>
                    	@if($v['reply'])
                    		<a href="/admin/reply/{{$v->gcid}}"><button class="btn btn-info">查看</button></a>
                    	@else
                    		<a href="/admin/reply/{{$v->gcid}}/edit"><button class="btn btn-success">回复</button></a>
                    	@endif
                    </td>
                </tr>
        		@endforeach
        </tbody></table>
		<div id="page_page" class="">
			{!! $comment->appends($request)->render()!!}
		</div>

		</div>
    </div>
</div>
@endsection